package quantum.error.correcting.code.finalone;

import java.io.*;

/**
 * @author sunkai
 * @version 09-03-27
 * 
 */
public class QuantumRunner
{

    /**
     * 
     */
    public QuantumRunner()
    {
    }

    /**
     * @param args
     */
    public static void main(String args[])
    {
        try
        {
            System.out.println("Please Input the Number: ");
            BufferedReader bufReader = new BufferedReader(new InputStreamReader(System.in));
            String line = bufReader.readLine();
            int n = Integer.parseInt(line);
            System.out.println("Please Input the Number R: ");
            bufReader = new BufferedReader(new InputStreamReader(System.in));
            line = bufReader.readLine();
            int r = Integer.parseInt(line);
            System.out.println("Please Input the Number K: ");
            bufReader = new BufferedReader(new InputStreamReader(System.in));
            line = bufReader.readLine();
            int k = Integer.parseInt(line);
            System.out.println("Please Input the Number of One in The Code(ie. 3 4): ");
            bufReader = new BufferedReader(new InputStreamReader(System.in));
            line = bufReader.readLine();
            int num = Integer.parseInt(line);
            int nn = n / 2;
            /*
             * new series calculator.
             */
            int seriesNum = r * (nn - k - r) + r * k + ((r * r - r)/2 + r) +  r * k + (nn - k - r) * k;
            System.out.println((new StringBuilder("Result: ")).append(seriesNum).toString());
        }
        catch(IOException e)
        {
            e.printStackTrace();
        }
    }
}
